package com.zhukunri.sp04.fegin;

import com.zhukunri.sp01.domain.User;
import com.zhukunri.sp01.web.util.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("USER-SERVICE")
public interface UserClient {

    //根据用户id获取用户
    @GetMapping("/{userId}")
    public JsonResult<User> getUser(@PathVariable("userId") Integer userId);


    //给用户添加积分
    @GetMapping("/{userId}/score")
    public JsonResult<?> addScore(@PathVariable("userId") Integer userId,@RequestParam("score") Integer score);
}
